package ee.mtiidla.data;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;

/**
 * Created by Marko on 12.10.2014.
 */
@XmlAccessorType(XmlAccessType.FIELD)
public class Ranking {

	private static final String [] ROMAN_NUMBERS = {"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X"};

	@XmlAttribute(name = "resultid")
	private long resultId;

	@XmlAttribute(name = "place")
	private int place;

	@XmlAttribute(name = "order")
	private int order;

	public long getResultId() {
		return resultId;
	}

	public void setResultId(long resultId) {
		this.resultId = resultId;
	}

	public int getPlace() {
		return place;
	}

	public void setPlace(int place) {
		this.place = place;
	}

	public int getOrder() {
		return order;
	}

	public void setOrder(int order) {
		this.order = order;
	}

	public String getPlaceRoman() {
		if (place <= 10 && place >= 0) {
			return ROMAN_NUMBERS[place];
		} else {
			return "";
		}
	}
}
